package org.project.utils;

import java.io.Serializable;

/**
 * 返回数据给前端的封装类
 *
 * @param <T>
 * @Auther: hzy
 * @Date: 2022/4/11
 */

public class Result2<T> implements Serializable {

    private static final long serialVersionUID = 1L;

    private boolean isSuccess;

    //返回信息
    private String message = "SUCCESS";

    //数据结果
    private T data;

    public Result2() {
    }

    public Result2(T data) {
        this.data = data;
    }

    public Result2(boolean isSuccess, T data) {
        this.isSuccess = isSuccess;
        this.data = data;
    }

    public Result2(boolean isSuccess, String message, T data) {
        this.isSuccess = isSuccess;
        this.message = message;
        this.data = data;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public boolean getIsSuccess() {
        return isSuccess;
    }

    public void setSuccess(boolean success) {
        isSuccess = success;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

}
